<?php
  require_once('tpl/header.php');
?>

   <?php 

	// mysql_connect("localhost","root","");
	// mysql_select_db("neuvideo");
	// mysql_set_charset("utf8");

	require("inc_admin.php");
	connect();

	$tid=$_GET["tid"];
	$typename=$_GET["typename"];
	$sql0="select * from videotype where typename='{$typename}'";
	$result0=mysql_query($sql0);
	$num=mysql_num_rows($result0);
 
 
	if ($num>0) {
		echo "该类型已存在，2s后将返回";
		header("refresh:2; url='typeList.php'");
	}else
	{
		$sql="update videotype set typename='{$typename}' where tid=$tid";
		$result=mysql_query($sql);
        	if($result==1)
        	{
        		echo "视频类型修改成功，2s后返回列表页";
        		header("refresh:2;url='typeList.php'");
        	}else
        	{
        		echo "修改失败";
        	}
	}

?>
<?php
  require_once('tpl/footer.php');
?>